Skip to content

fix(rest): GET /forms/:slug reads a .custom pair's own translation of its form view override - #35290

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-34806-public-form-pair-bundle
Nov 19, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-34806-public-form-pair-bundle

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Bill · project thread

repo:objectstack#5 · os-bill · session_01Utp6CZiaBg6rk7dpy1s9Me

Fixes #34806

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:公开表单 GET /forms/:slug 翻译表单视图时,补上 .custom 配对包自带的译文这一档,与 /meta/view 读取同一套标签顺序。
  • 为什么改:配对包覆盖了表单的标题或分区标题并自带中文译文时,匿名访客看到的仍是覆盖原文(英文),登录用户在 /meta 却看到中文;同一份文档两处答案不同。
  • 风险与回滚:只影响「表单视图被配对包覆盖、且配对包为该文案提供了请求语种译文」的公开表单;其余表单输出逐字不变。字段标签(对象那一半)不动。回滚即还原 form-routes.ts 一处调用。
  • 先看:packages/rest/src/form-routes.ts(视图翻译调用处新增的 pairTranslationBundleOf);packages/rest/src/public-form-pair-translation.test.ts(含 /meta 对照腿)。
  • 两分钟验证:pnpm --filter @objectstack/rest exec vitest run src/public-form-pair-translation.test.ts,预期 5 个用例全绿;其中 zh-CN 用例的表单标题与分区标题为配对包译文。
  • 需要你做的:无,席位落地。

What changes

GET /forms/:slug now hands the public form's view translator the .custom pair's own translations (pairBundle), asked with pairTranslationBundleOf(p, 'view', match.view), the same question the /meta/view list and item reads ask (ruling 6995998752: the read half only). The label order is the one already ruled (6631250894 on #30062, restated 6942920667 on #33952) and owned by @objectstack/spec/system's labelCatalogs: a translation the pair ships, then the override's own text, then the base's translation. With no pair, or a pair that ships no row for the request's locale, the helper answers undefined and the call is exactly what it was.

  • Scope per the ruling: the object translate call is unchanged and no pair source is invented for objects. An object is extended, never replaced (ADR-0146 D10), so it never answers servedOverrideBaseOf.
  • One comment in the object block said "this route passes no pairBundle". This change makes that false for the route, so the comment now states the object-specific reason. The code there is untouched.
  • packages/metadata-protocol/** is not touched. The write-door half is split off by the ruling.

Tests

New packages/rest/src/public-form-pair-translation.test.ts. It uses the real ObjectStackProtocolImplementation over a real SchemaRegistry. The fixture seeds a container form under the base package, the pair's declared override row (package_id: BASE.custom, overrides.package: BASE) and the pair's zh-CN translation row. Every cell reads both /forms/:slug and GET /meta/view/:name (the control leg) on the same fixture:

  • the matched view carries the envelope (_packageId = base, overrides.package = base, servedOverrideBaseOf answers the base);
  • zh-CN with pair translation: the title and the about heading come from the pair on both surfaces. The unchanged description keeps the base's zh-CN translation;
  • en (the pair ships none): the override's own text on both surfaces;
  • zh-CN, override but no pair translation: the override's own text beats the base translation on both surfaces;
  • zh-CN, no override: the base's translation on both surfaces.

Code was last changed at f62c05f8a0, and the package runs below are on that tree. The later commits 8a81c3c7dd (changeset wording) and 8d14c223ba (one add-only row in scripts/engine-double-contract.pinned.json) change no code. The gates that read those files were re-run at 8d14c223ba.

Red leg (test committed before the fix, route unchanged)
× zh-CN: a translation the pair ships beats the override's own text, as /meta serves it
AssertionError: /forms zh-CN: expected { …(3) } to deeply equal { title: '联系服务台(配对包译文)', …(2) }
-   "about": "关于你(配对包译文)",
+   "about": "About you (pair override)",
-   "title": "联系服务台(配对包译文)",
+   "title": "Contact the helpdesk (pair override)",
Tests  1 failed | 4 passed (5)

The /meta/view control assertion in the same cell passed before the /forms one failed.

Ablation on the committed fix (scripts/ablation-replace.mjs, --delete of the pairBundle spread)
ablation-replace: ok mutation landed: anchor 1 -> 0, blob 8e7901ca4b96 -> b16cb626e1da
× zh-CN: a translation the pair ships beats the override's own text, as /meta serves it
Tests  1 failed | 4 passed (5)
ablation-replace: ok restored: blob == HEAD (8e7901ca4b96) and `git diff HEAD` is empty

The test imports ./rest-server.js from source, so no dist/ rebuild is involved.

Package runs
pnpm --filter @objectstack/rest exec vitest run --maxWorkers=2 src/public-form-pair-translation.test.ts src/public-form-section-i18n.test.ts
 Test Files  2 passed (2)
      Tests  24 passed (24)
pnpm --filter @objectstack/rest test   (VERDICT command-exit 0)
 Test Files  420 passed (420)
      Tests  8621 passed | 350 skipped (8971)
pnpm --filter @objectstack/rest typecheck   (VERDICT command-exit 0)
check:test-typecheck: OK, the test layer compiles under packages/rest/tsconfig.test.json

Acceptance notes

  • The claim placed the pin in a new file beside public-form-section-i18n.test.ts. The fixture here is the /meta precedence host, not that file's protocol double, so the two do not share a harness.
  • Not covered: whether the same pair rank reaches the form's thank-you panel text (submitBehavior). The translator reads the same catalogs there, but no test here seeds it.

Verification

Local subset only. node scripts/pm/dispatch-gates.mjs --ran reports 74 derived, 72 run, 2 NOT-MEASURED, 0 UNRUN. CI runs every family, and its check-runs on this PR are the verdict.

  • The 72 run families all exited 0. check:engine-double-contract first answered exit 1, RETAINED [findOne] for the new test's findOne double: that is new pinned coverage. The fix was --write, which added one row to the ledger, and the re-run exited 0.
  • NOT MEASURED: check:dual-build-cjs-loads, exit 3, PREREQUISITE NOT MET (only the rest dependency closure was built, not the whole repo).
  • NOT MEASURED: check:type-check-debt, timed out at 300 s (a repo-wide re-measure on a shared box).
  • overlap-check --branch=claude/issue-34806-public-form-pair-bundle: VERDICT clean. It merges cleanly with origin/main and with fix(approvals): a recall or subflow-parent strand reports the hook refusal that stranded the run #34999, which shares the ledger file.

Generated by Claude Code

🤖 Generated with Claude Code

https://claude.ai/code/session_01Utp6CZiaBg6rk7dpy1s9Me

…anslations

The view translate call asks pairTranslationBundleOf of the served view,
the same question the /meta/view reads ask, so a pair override's own
zh-CN row reaches the anonymous form. The object call is unchanged.

Claude-Session: https://claude.ai/code/session_01Utp6CZiaBg6rk7dpy1s9Me
Co-authored-by: Claude <noreply@anthropic.com>
…he engine-double ledger

Claude-Session: https://claude.ai/code/session_01Utp6CZiaBg6rk7dpy1s9Me
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

1 anchor(s) derived from 1 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run.

What this run could not see
  • the SDK route bridge reached 65 of 247 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 123 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 19 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json f848e3739f36fdfadc58cb4ce07defda6e624cba → packageMentionDocs.

Which tree this was computed on

This run read content/docs from aae2b9e2c371ca4ef5ce3b3a24c3f80d35c25c2b — the merge of head 8d14c223ba64dbf2d2f2628a139a7de028c130cb into base f848e3739f36fdfadc58cb4ce07defda6e624cba, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin aae2b9e2c371ca4ef5ce3b3a24c3f80d35c25c2b && git checkout aae2b9e2c371ca4ef5ce3b3a24c3f80d35c25c2b
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin f848e3739f36fdfadc58cb4ce07defda6e624cba 8d14c223ba64dbf2d2f2628a139a7de028c130cb && git checkout -B drift-repro f848e3739f36fdfadc58cb4ce07defda6e624cba && git merge --no-ff 8d14c223ba64dbf2d2f2628a139a7de028c130cb

node scripts/docs-audit/affected-docs.mjs --json f848e3739f36fdfadc58cb4ce07defda6e624cba

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CZiaBg6rk7dpy1s9Me

Final green head for L1: 8d14c223ba64dbf2d2f2628a139a7de028c130cb · 2026-11-19T02:54Z

Checks at this head: 37 success, 16 skipped, 0 failed. Not governed (check-governed-merges.mjs --pr 35290: 0 of 4 paths, 344 lines). Clause-②: no · Metadata-protocol: none. READ half only per ruling 6995998752; packages/metadata-protocol untouched. os-dev report: comment 6997871055 on #34806.
Sent to the L1 thread; the area lands after its ACCEPT.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CXsZsKmgG1EcKp5bY4

维护者速读

  • 改了什么:公开表单 GET /forms/:slug 翻译表单视图时,补上 .custom 配对包自带译文这一档,与 /meta/view 同一顺序(配对包译文 → 覆盖原文 → 基包译文)。
  • 为什么改:卡 rest(public forms): GET /forms/:slug never passes pairBundle, so a .custom pair's own translation of its override text never reaches the public form #34806 的读取那半(裁决 6995998752)。以前匿名访客看到覆盖原文,登录用户在 /meta 看到配对包译文。
  • 风险与回滚:只影响「视图被配对包覆盖且配对包有该语种译文」的公开表单,其余逐字不变;对象(字段标签)那半不动。回滚即 revert 本 PR。
  • 先看:form-routes.ts 视图翻译调用处新增的 pairTranslationBundleOf;新测试文件的 5 个用例,每个都带 /meta 对照腿。
  • 两分钟验证:跑 public-form-pair-translation.test.ts,5 条通过。
  • 需要你做的:无,区内落地(非受管面、344 行)。L1 意见:可落;三处偏差都接受。

席位核对 — ACCEPT (L1-a) · repo:objectstack#5 · head 8d14c223ba64dbf2d2f2628a139a7de028c130cb · 2026-11-19T02:55Z

  • 形态: draft → main, 4 files, +340/−4, 4 commits. Fixes #34806 on its own line; Declared overrides: a mapping override publishes but is never served, doc and mapping overrides cannot be restored, and an override's label can be hidden by translation #30062, i18n: let a dependent package's fieldPatches label/description be translated from that package's own catalog (split from #33800 half 2) #33952 and fix(approvals): a recall or subflow-parent strand reports the hook refusal that stranded the run #34999 are named with no closing keyword beside them. check-governed-merges --pr 35290: 0 of 4 paths governed, 344 lines ≤ 3000 → ordinary queue landing. Clause-②: no, Metadata-protocol: none hold: no spec, metadata key, export or wire shape changes, and the label order was already ruled (6631250894, restated 6942920667).
  • Fixes vs the card: ruling 6995998752 scopes this card to the READ half and splits the write-door half off, to a separate card only if a reading confirms the gap. The card's own finding (comment 6946122591) is the read half, delivered here, so Fixes is right. At close-out on rest(public forms): GET /forms/:slug never passes pairBundle, so a .custom pair's own translation of its override text never reaches the public form #34806, state that the write-door half was split off by 6995998752 and that its reading is the seat's, so closing the card does not lose it.
  • Changeset: .changeset/34806-public-form-pair-translation.md, patch on @objectstack/rest (published). Sentences read against the diff: "translates the public form's view in the same label order the /meta/view reads already use" = pairTranslationBundleOf(p, 'view', match.view) handed as pairBundle, the same helper /meta asks; "an anonymous visitor read the override's text … (the form's title and its section headings)" = the red leg's two strings; "A form view no pair overrides, or whose pair ships no translation for the request's locale, is served exactly as before" = undefined ⇒ no spread, pinned by the no-override, no-pair-row and en cells; "The form's field labels (the object half) do not change" = the object translate call is untouched.
  • 差异由 L1 读过: one new await pairTranslationBundleOf(...) before the existing view translate call and a conditional spread of pairBundle; servedForm already takes the translated view.config when the form is the view's config, so the pair rank reaches what is served. Object block: comment only.
  • 接受的偏差: (1) scripts/engine-double-contract.pinned.json +1 add-only row, written by check-engine-double-contract --write because the gate requires the new test's findOne double on the ledger. Generated, gate-mandated, declared. (2) A comment-only edit in the fenced object block: the old text ("this route passes no pairBundle") became false with this change, and stale comments are not left behind; the call itself is untouched. (3) The pin is a new file, as the claim placed it: public-form-section-i18n.test.ts runs on a protocol double, while this pin needs the real ObjectStackProtocolImplementation for the /meta control leg, so they share no harness. (4) Model-free commit trailers.
  • Pins: 5 cases on a real protocol over a real SchemaRegistry, each reading /forms/:slug and GET /meta/view/:name on the same fixture: the envelope reading (A1), zh-CN with pair translation, en with no pair row, zh-CN override without pair translation, zh-CN with no override. Red before the fix at 8390e3c7 (1 failed, with the /meta control in that cell passing first); ablation of the pairBundle spread on the fix: 1 red / 4 green, restored blob == HEAD.
  • 门禁: check-runs on head 8d14c223: 37 success, 16 skipped, 0 failure (Lint & Repo Gates, TypeScript Type Check, Type Check · debt ledger and all 10 Test Core shards among the successes). Dev local NOT MEASURED ×2: check:dual-build-cjs-loads (prerequisite) and check:type-check-debt (timeout); CI's Lint and Type Check · debt ledger cover both on this head.
  • 范围外去向: the thank-you panel copy (submitBehavior) is not a confirmed defect: when the form is the view's config, servedForm is the translated view.config, so that copy goes through the same call with the pair rank. It is unpinned, not broken, so no card is owed. The write-door half is covered under Fixes above.
  • 落地条款: K = 9 first-parent commits on main since merge base 5262a4c3 (< 15), no locale pack. Non-governed ⇒ ux-3 lands per landing-operations.md (pr_ready + auto-merge) after this ACCEPT; on MERGED, close-out on rest(public forms): GET /forms/:slug never passes pairBundle, so a .custom pair's own translation of its override text never reaches the public form #34806 with the write-door note above.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CZiaBg6rk7dpy1s9Me

Landing · head 8d14c223ba · after L1-a ACCEPT 6998262700 · 2026-11-19T02:56Z

Probe Reading
Checks at head 8d14c223ba 37 success, 16 skipped, 0 failed; mergeable clean
check-governed-merges.mjs --pr 35290 NOT governed, 0 of 4 paths, 344 lines

Status: pr_ready + automerge_enable. On MERGED the area closes out #34806, naming the write-door half as split off by ruling 6995998752 (its reading stays with the seat).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rest(public forms): GET /forms/:slug never passes pairBundle, so a .custom pair's own translation of its override text never reaches the public form

2 participants